// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   query_ok.java

package hr.engage.pass;

import include.nseer_cookie.counter;
import include.nseer_db.nseer_db_backup1;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class query_ok extends HttpServlet
{

	ServletContext application;
	HttpSession session;

	public query_ok()
	{
	}

	public synchronized void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		ServletContext dbApplication = dbSession.getServletContext();
		try
		{
			HttpSession session = request.getSession();
			PrintWriter out = response.getWriter();
			nseer_db_backup1 hr_db = new nseer_db_backup1(dbApplication);
			counter count = new counter(dbApplication);
			if (hr_db.conn((String)dbSession.getAttribute("unit_db_name")))
			{
				String details_number = request.getParameter("details_number");
				String register_time = request.getParameter("register_time");
				String register = request.getParameter("register");
				int filenum = count.read((String)dbSession.getAttribute("unit_db_name"), "hrFilecount");
				count.write((String)dbSession.getAttribute("unit_db_name"), "hrFilecount", filenum);
				String human_ID = (new StringBuilder("HF000000")).append(filenum).toString();
				try
				{
					String sql1 = (new StringBuilder("select * from hr_resume where details_number='")).append(details_number).append("'").toString();
					ResultSet rs1 = hr_db.executeQuery(sql1);
					if (rs1.next())
					{
						String sql = (new StringBuilder("insert into hr_file(human_ID,human_name,human_address,human_tel,human_home_tel,human_postcode,educated_degree,educated_years,educated_major,register,register_time,history_records,human_cellphone,idcard,religion,race,nationality,party,age,birthday,birthplace,sex,speciality,hobby,human_email,picture,attachment_name) values('")).append(human_ID).append("','").append(rs1.getString("human_name")).append("','").append(rs1.getString("human_address")).append("','").append(rs1.getString("human_tel")).append("','").append(rs1.getString("human_home_tel")).append("','").append(rs1.getString("human_postcode")).append("','").append(rs1.getString("educated_degree")).append("','").append(rs1.getString("educated_years")).append("','").append(rs1.getString("educated_major")).append("','").append(register).append("','").append(register_time).append("','").append(rs1.getString("history_records")).append("','").append(rs1.getString("human_cellphone")).append("','").append(rs1.getString("idcard")).append("','").append(rs1.getString("religion")).append("','").append(rs1.getString("race")).append("','").append(rs1.getString("nationality")).append("','").append(rs1.getString("party")).append("','").append(rs1.getString("age")).append("','").append(rs1.getString("birthday")).append("','").append(rs1.getString("birthplace")).append("','").append(rs1.getString("sex")).append("','").append(rs1.getString("speciality")).append("','").append(rs1.getString("hobby")).append("','").append(rs1.getString("human_email")).append("','").append(rs1.getString("picture")).append("','").append(rs1.getString("attachment_name")).append("')").toString();
						hr_db.executeUpdate(sql);
					}
					String sql2 = (new StringBuilder("delete from resume where details_number='")).append(details_number).append("'").toString();
					hr_db.executeUpdate(sql2);
					hr_db.commit();
					hr_db.close();
					response.sendRedirect("hr/engage/pass/query_ok_a.jsp");
				}
				catch (Exception ex)
				{
					out.println((new StringBuilder("error")).append(ex).toString());
				}
			} else
			{
				response.sendRedirect("error_conn.htm");
			}
		}
		catch (Exception exception) { }
	}
}
